import { request, post, get } from "@/utils/request";
import axios from 'axios'

class sysConfigApi {

  // 获取配置详情
  getDefinition(data: any) {
    let url = `/merchant/config/external/getDefinition`
    return request(url, data)
  }


  // 获取配置类型列表
  getConfigurationTypes(data: any) {
    let url = `/merchant/config/external/getConfigurationTypes`
    return request(url, data)
  }

  // 获取指定配置类型下的平台列表
  getPlatforms(data: any) {
    let url = `/merchant/config/external/getPlatforms`
    return request(url, data)
  }


  // 新增或编辑配置
  saveOrUpdateConfig(data: any) {
    let url = `/merchant/config/external/saveOrUpdateConfig`
    return request(url, data)
  }

  // 删除配置
  delConfig(data: any) {
    let url = `/merchant/config/external/delConfig`
    return request(url, data)
  }

  // 添加ip限制
  addIpLimit(data: any) {
    let url = `/merchant/config/ip/addLimit`
    return request(url, data)
  }

  // 修改ip限制
  updateLimit(data: any) {
    let url = `/merchant/config/ip/updateLimit`
    return request(url, data)
  }

  // 删除ip限制
  delIpLimit(data: any) {
    let url = `/merchant/config/ip/delLimit`
    return request(url, data)
  }


  // 获取相关平台配置
  getConfigList(data: any) {
    let url = `/merchant/config/external/configList`
    return request(url, data)
  }




  // 获取当前用户的机构系统配置信息
  getSystemInsConfig() {
    let url = `/merchant/config/getSystemInsConfig`
    return request(url)
  }


  // 获取当前用户的商户系统配置信息
  getSystemMerchantConfig() {
    let url = `/merchant/config/getSystemMerchantConfig`
    return request(url)
  }

  // 重置机构系统配置信息
  resetSystemInsConfig() {
    let url = `/merchant/config/resetSystemInsConfig`
    return request(url)
  }


  // 重置商户系统配置信息
  resetSystemMerchantConfig() {
    let url = `/merchant/config/resetSystemMerchantConfig`
    return request(url)
  }

  /**
   * 获取直充类正则配置
   */
  getRegexList(data: any) {
    let url = `/merchant/regex/list`
    return request(url, data)
  }
  //点击生成二维码
  wechatPlatformAuth(data: any) {
    let url = `/merchant/wechatComponent/wechat_platform/auth`
    return request(url, data)
  }
  //点击生成二维码
  merchantAuthSearch(data: any) {
    let url = `/merchant/wechatComponent/merchant/auth/search`
    return request(url, data)
  }

}
export default new sysConfigApi()
